Skip to content

Fix forest fire networkx dependency#387

Open
GITUSERMANOLYA wants to merge 1 commit intomesa:mainfrom
GITUSERMANOLYA:fix-forest-fire-networkx-dependency
Open

Fix forest fire networkx dependency#387
GITUSERMANOLYA wants to merge 1 commit intomesa:mainfrom
GITUSERMANOLYA:fix-forest-fire-networkx-dependency

Conversation

@GITUSERMANOLYA
Copy link

@GITUSERMANOLYA GITUSERMANOLYA commented Mar 15, 2026

GSoC contributor checklist

Context & motivation

I am a beginner in open source, I went through many organizations and picked this particular organization and this particular project as it is simple and aligned with the skills I am good at.I was exploring the mesa-examples repository as part of my GSoC 2026 application for the Mesa Examples Revival project. I ran all 22 examples to understand the current state of the repo. When I ran the forest_fire example, I got a ModuleNotFoundError for networkx. I checked the requirements.txt and networkx was missing, so I added it.

What I learned

I learned how Python dependency management works with requirements.txt. I also learned how to use git rebase to clean up a PR branch, and how the GitHub PR review process works. This was my first open source contribution. I am polishing my basic knowledge of git commands. This gave me an exciting opportunity to learn and explore more of git and github and open source projects

Learning repo

🔗 My learning repo: https://github.com/GITUSERMANOLYA/GSoC-learning-space
🔗 Relevant model(s): N/A

Readiness checks

  • This PR addresses an agreed-upon problem (linked issue or discussion with maintainer approval), or is a small/trivial fix
  • I have read the contributing guide and deprecation policy
  • I have performed a self-review
  • Another GSoC contributor has reviewed this PR: @Harshini2411
  • Tests pass locally
  • Code is formatted

@EwoutH
Copy link
Member

EwoutH commented Mar 15, 2026

Thanks for the PR. Could you git rebase it? It looks like it now changes a lot, which it probably doesn't.

@GITUSERMANOLYA
Copy link
Author

Thanks for the PR. Could you git rebase it? It looks like it now changes a lot, which it probably doesn't.

Hi! I'm new to using Git. I've rebased the branch. The diff only contains the single networkx line addition to requirements.txt. Let me know if anything else is needed!

@EwoutH
Copy link
Member

EwoutH commented Mar 16, 2026

For some reason 3 other commits are included. I normally sync the upstream main branch and then rebase my PR branch on the upstream main branch.

@Harshini2411
Copy link

Hey! Reviewed this PR 👋
The fix itself is correct, networkx was definitely missing from requirements.txt and this is the right place to add it.
One thing though your PR seems to have picked up 3 extra commits that aren't related to this fix (the CI update, M/M/c queue example, and README update). That's probably why the diff shows +312/-18 instead of just +1 line.
@EwoutH already mentioned this too. You'd need to rebase onto upstream main to clean those up:

git remote add upstream https://github.com/projectmesa/mesa-examples
git fetch upstream
git rebase upstream/main
git push --force-with-lease origin fix-forest-fire-networkx-dependency

Once that's sorted the PR should be good to merge! Happy to take another look after the rebase 🙂

@GITUSERMANOLYA GITUSERMANOLYA force-pushed the fix-forest-fire-networkx-dependency branch from 75cc3e8 to af11d84 Compare March 20, 2026 13:35
@GITUSERMANOLYA GITUSERMANOLYA force-pushed the fix-forest-fire-networkx-dependency branch from af11d84 to 0a5c212 Compare March 20, 2026 13:45
@GITUSERMANOLYA
Copy link
Author

Done! Rebased onto upstream/main. The diff now shows only the single +networkx line addition.Thanks for the help!! EwoutH and Harshini2411!

@@ -1,2 +1,3 @@
jupyter
mesa[viz]>=3.0
networkx
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added networkx as it was missing from requirements.txt, which caused a ModuleNotFoundError when running the forest_fire example.

@Harshini2411
Copy link

Looks good now! The rebase is clean, diff is exactly the one line it should be, and the fix is correct. LGTM and ready to merge! 🙌

@codebreaker32
Copy link
Collaborator

I see forest_fire is based on Grid then why do we need networkx as dependency? Am I missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants